<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div class="gv-page-container">
  <a [routerLink]="['..']" class="gv-back-link"><small><< Back to entrypoints</small></a>
  <h1>New Entrypoint</h1>
  <div>
    <form (ngSubmit)="create()" #entrypointForm="ngForm" fxLayout="column" fxFlex="70">
      <div class="gv-form-section">
        <mat-form-field appearance="outline" floatLabel="always">
          <mat-label>Name</mat-label>
          <input matInput type="text" placeholder="Name" name="name" [(ngModel)]="entrypoint.name" required>
          <mat-hint>A name for the entrypoint.</mat-hint>
        </mat-form-field>

        <mat-form-field appearance="outline" floatLabel="always">
          <mat-label>Description</mat-label>
          <input matInput type="text" placeholder="Description" name="description" [(ngModel)]="entrypoint.description">
          <mat-hint>A description for the entrypoint.</mat-hint>
        </mat-form-field>

        <mat-form-field appearance="outline" floatLabel="always">
          <mat-label>Entrypoint url</mat-label>
          <input matInput type="text" placeholder="Entrypoint" name="url" [(ngModel)]="entrypoint.url" required pattern="https?://.+">
          <mat-hint>An url for the entrypoint.</mat-hint>
        </mat-form-field>
      </div>
      <div fxLayout="row" fxLayoutAlign="end">
        <a mat-button [routerLink]="['..']" style="margin-right: 20px;">CANCEL</a>
        <button mat-raised-button [disabled]="!entrypointForm.valid || entrypointForm.pristine" type="submit">CREATE</button>
      </div>
    </form>
    <div class="gv-page-description" fxFlex>
      <h3>Entrypoint ?</h3>
      <div class="gv-page-description-content">
        <p>
          An entrypoint allows you to display the url to use when end-user applications will contact the AM Gateway.
        </p>
      </div>
    </div>
  </div>
</div>
